package com.studio49.exmple.common.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.http.HttpHost;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

public class HttpClientUtilCustom {

	private static Logger logger = LogManager.getLogger(HttpClientUtilCustom.class);

	private static final int TIMEOUT = 90 * 1000;
	// private static final int TIMEOUT = 3600 * 1000;// debug用

	private static final int SUCCESS_STATUS = 200;

	private static final String DEFAULT_CHATSET = "UTF-8";

	private static final String DEFAULT_CONTENT_TYPE = "application/json";

	private static CloseableHttpClient httpClient = null;

	private final static Object syncLock = new Object();

	private HttpClientUtilCustom() {
	}

	private static void config(HttpRequestBase httpRequestBase) {
		// 配置请求的超时设置
		RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(TIMEOUT)
				.setConnectTimeout(TIMEOUT).setSocketTimeout(TIMEOUT).build();
		httpRequestBase.setConfig(requestConfig);
	}

	/**
	 * 获取HttpClient对象
	 */
	public static CloseableHttpClient getHttpClient(String url) {
		String hostname = url.split("/")[2];
		int port = 80;
		if (hostname.contains(":")) {
			String[] arr = hostname.split(":");
			hostname = arr[0];
			port = Integer.parseInt(arr[1]);
		}
		synchronized (syncLock) {
			if (httpClient == null) {
				httpClient = createHttpClient(hostname, port, 100, 10, 20);
			}
		}
		return httpClient;
	}

	/**
	 * 创建HttpClient对象
	 * 
	 */
	public static CloseableHttpClient createHttpClient(String hostname, int port, int maxTotal, int maxPerRoute,
			int maxRoute) {
		ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory();
		LayeredConnectionSocketFactory sslsf = SSLConnectionSocketFactory.getSocketFactory();
		Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
				.register("http", plainsf).register("https", sslsf).build();
		PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
		// 将最大连接数增加
		cm.setMaxTotal(maxTotal);
		// 将每个路由基础的连接增加
		cm.setDefaultMaxPerRoute(maxPerRoute);
		HttpHost httpHost = new HttpHost(hostname, port);
		// 将目标主机的最大连接数增加
		cm.setMaxPerRoute(new HttpRoute(httpHost), maxRoute);

		CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build();

		return httpClient;
	}

	private static void setPostParams(HttpPost httpost, Map<String, Object> params) {
		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		Set<String> keySet = params.keySet();
		for (String key : keySet) {
			nvps.add(new BasicNameValuePair(key, params.get(key).toString()));
		}
		try {
			httpost.setEntity(new UrlEncodedFormEntity(nvps, DEFAULT_CHATSET));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	public static String doGet(String requestUrl) {
		return doGet(requestUrl, DEFAULT_CHATSET);
	}

	/**
	 * GET请求URL获取内容
	 */
	public static String doGet(String requestUrl, String charset) {
		String responseString = "";
		long bgTime = System.currentTimeMillis();

		HttpGet httpget = new HttpGet(requestUrl);
		config(httpget);
		CloseableHttpResponse response = null;
		try {
			response = getHttpClient(requestUrl).execute(httpget, HttpClientContext.create());
			int statusCode = response.getStatusLine().getStatusCode();
			if (statusCode == SUCCESS_STATUS) {
				responseString = readResponseBodyAsString(response.getEntity().getContent(), charset);
			} else {
				logger.error("Process reqeust failed, http response statusline is : {}", response.getStatusLine());
			}
		} catch (Exception e) {
			logger.error("Send request failed. ", e);
		} finally {
			try {
				if (response != null)
					response.close();
			} catch (IOException e) {
				logger.error("Send request failed. ", e);
			}
		}
		long costTime = System.currentTimeMillis() - bgTime;
		logger.info("RP = {}，CT = {}", responseString, costTime);
		return responseString;
	}

	public static String doPost(String requestUrl, Map<String, Object> params) {
		return doPost(requestUrl, params, DEFAULT_CHATSET);
	}

	/**
	 * POST请求URL获取内容
	 * 
	 */
	public static String doPost(String requestUrl, Map<String, Object> params, String charset) {

		String responseString = "";
		long bgTime = System.currentTimeMillis();

		HttpPost httppost = new HttpPost(requestUrl);
		config(httppost);
		setPostParams(httppost, params);
		CloseableHttpResponse response = null;

		try {
			response = getHttpClient(requestUrl).execute(httppost, HttpClientContext.create());
			int statusCode = response.getStatusLine().getStatusCode();
			if (statusCode == SUCCESS_STATUS) {
				responseString = readResponseBodyAsString(response.getEntity().getContent(), charset);
			} else {
				logger.error("Process reqeust failed, http response statusline is : {}", response.getStatusLine());
			}
		} catch (Exception e) {
			logger.error("Send request failed. ", e);
		} finally {
			try {
				if (response != null)
					response.close();
			} catch (IOException e) {
				logger.error("Send request failed. ", e);
			}
		}
		long costTime = System.currentTimeMillis() - bgTime;
		logger.info("RP = {}，CT = {}", responseString, costTime);
		return responseString;
	}

	public static String doPostJosn(String requestUrl, String requestJsonString) {
		return doPostJosn(requestUrl, requestJsonString, DEFAULT_CHATSET);
	}

	public static String doPostJosn(String requestUrl, String requestJsonString, String charset) {
		String responseString = "";
		long bgTime = System.currentTimeMillis();

		HttpPost httppost = new HttpPost(requestUrl);
		config(httppost);
		CloseableHttpResponse response = null;

		try {
			StringEntity requestEntity = new StringEntity(requestJsonString, charset);
			httppost.setEntity(requestEntity);
			httppost.setHeader(HTTP.CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
			response = getHttpClient(requestUrl).execute(httppost, HttpClientContext.create());
			int statusCode = response.getStatusLine().getStatusCode();

			if (statusCode == SUCCESS_STATUS) {
				responseString = readResponseBodyAsString(response.getEntity().getContent(), charset);
			} else {
				logger.error("Process reqeust failed, http response statusline is : {}", response.getStatusLine());
			}
		} catch (Exception e) {
			logger.error("Send request failed. ", e);
		} finally {
			try {
				if (response != null)
					response.close();
			} catch (IOException e) {
				logger.error("Send request failed. ", e);
			}
		}
		long costTime = System.currentTimeMillis() - bgTime;
		logger.info("RP = {}，CT = {}", responseString, costTime);
		return responseString;
	}

	/**
	 * 将 response流读取为String。
	 * 
	 * @param responseBody
	 * @return
	 * @throws Exception
	 */
	private static String readResponseBodyAsString(InputStream responseBody, String charset) throws Exception {
		StringBuffer buffer = new StringBuffer();
		BufferedReader reader = null;

		try {
			reader = new BufferedReader(
					new InputStreamReader(responseBody, charset == null ? DEFAULT_CHATSET : charset));
			String line;
			while ((line = reader.readLine()) != null) {
				buffer.append(line);
			}
		} catch (Exception e) {
			throw e;
		} finally {
			try {
				if (reader != null) {
					reader.close();
				}
			} catch (IOException e) {
				throw e;
			}
		}

		return buffer.toString();
	}

	public static void Test_findProductGoodsList() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/findProductGoodsList";
		System.out.println(uri);
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "b053e1f245744a78bcb69a6c57babd46");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtcXGRL+L8qTETcauxp0aQncgy6obG5Lj465/uFqnR8z4zTnVkyT0APqaGRy9G7x/Z2z+zGFUCktPt5rdMhSZkU0=");
		params.put("goodsType", 1);
		params.put("subjectType", 1);
		params.put("gradeType", 1);
		params.put("platformType", 2);
		String doPost = doPost(uri, params);
		System.out.println(doPost);
	}

	public static void Test_findResourceUrl() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/findResourceUrl";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		params.put("goodsId", 201823);
		params.put("platformType", 1);
		String doPost = doPost(uri, params);
		System.out.println(doPost);
	}

	public static void Test_getVerificationCode() {
		String uri = "http://172.16.16.5:80/ARVR/action/appInterface";
		uri += "/appUser/getVerificationCode";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("mobile", "15966537896");
		params.put("moduleFlag", 1);
		String doPost = doPost(uri, params);
		System.out.println(doPost);
	}

	public static void Test_findProductCourseList() {
		String uri = "http://14.23.47.108:10080/ARVR/action/appInterface";
		uri += "/appProduct/findProductCourseList";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		params.put("goodsId", 201812);
		// params.put("goodsPrice", 1);
		// params.put("exchangeType", 1);
		String doPost = doPost(uri, params);
		System.out.println(doPost);

	}

	public static void Test_exchangeProductGoods() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/exchangeProductGoods";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "b053e1f245744a78bcb69a6c57babd46");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtcXGRL+L8qTETcauxp0aQncgy6obG5Lj465/uFqnR8z4zTnVkyT0APqaGRy9G7x/Z2z+zGFUCktPt5rdMhSZkU0=");
		params.put("goodsId", 2816);
		params.put("goodsPrice", 1);
		params.put("exchangeType", 2);
		params.put("goodsType", 1);
		String doPost = doPost(uri, params);
		System.out.println(doPost);

	}
	
	public static void Test_findGiftBagByGoodIdList() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/findGiftBagByGoodIdList";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "b053e1f245744a78bcb69a6c57babd46");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtcXGRL+L8qTETcauxp0aQncgy6obG5Lj465/uFqnR8z4zTnVkyT0APqaGRy9G7x/Z2z+zGFUCktPt5rdMhSZkU0=");
		params.put("goodsType", 1);
		params.put("goodsId", 2816);

		String doPost = doPost(uri, params);
		System.out.println(doPost);

	}

	public static void test_findCorrelatedGoods() {
		String uri = "http://14.23.47.108:10080/ARVR/action/appInterface";
		uri += "/appProduct/findCorrelatedGoods";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		params.put("courseId", 201805L);
		params.put("gradeType", "1");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_findConfigRechargeList() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/findConfigRechargeList";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_weChatRecharge() {
		String uri = "http://172.16.16.5:80/ARVR/action/appInterface";
		uri += "/weChat/weChatRecharge";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		params.put("rechargeId", "578");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_appUserSign() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appUser/appUserSign";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_receiveSignAward() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appUser/receiveSignAward";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_findAppNoticeList() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appUser/findAppNoticeList";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "172122d34199aea633c8aadd9e8edec");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtXlCNE5AL0MMxTEWpslnfK5Mnp2iu3RUYzSvtRdMJ5rM84XeGpHL+AlOubyNgQws7G+srQuIJFnzI6dIvltvpr4=");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_findAppUserExercisesCourseList() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/findAppUserExercisesCourseList";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "b053e1f245744a78bcb69a6c57babd46");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtcXGRL+L8qTETcauxp0aQncgy6obG5Lj465/uFqnR8z4zTnVkyT0APqaGRy9G7x/Z2z+zGFUCktPt5rdMhSZkU0=");
		params.put("subjectType", 1);
		params.put("gradeType", 1);
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_learningObjectivesStats() {
		String uri = "http://14.23.47.108:10080/ARVR/action/appInterface";
		uri += "/appProduct/learningObjectivesStats";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c0605f5d");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GnEj+wZAPoeq7BokltC/wvFBMkoNsvcqXaZmBo85aL3T8=");
		params.put("gradeType", "1");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_mobileLogin() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appUser/mobileLogin";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "b053e1f245744a78bcb69a6c57babd46");
		params.put("mobile", "26320899951");
		params.put("password", "345678");
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
		Test_findProductGoodsList();
	}

	public static void test_appUserStartAnswer() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/appUserStartAnswer";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		params.put("paperId", 217057);
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_paperTestTemporary() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/paperTestTemporary";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		params.put("userPaperTestId", 224103);

		Map<String, Object> map = Maps.newHashMap();
		Map<String, Object> answerMap = Maps.newHashMap();
		answerMap.put("answerId", 202515);
		List<Map<String, Object>> answerList = Lists.newArrayList();
		answerList.add(answerMap);
		map.put("exerciseId", 202512);
		map.put("answerList", answerList);
		params.put("isHeartbeat", 0);

		List<Object> list = Lists.newArrayList();
		list.add(map);

		String jsonStr = JSONArray.toJSONString(list);
		params.put("temporaryExerciseAndAnswerStr", jsonStr);
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	public static void test_submitUserPaperTest() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/submitUserPaperTest";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		params.put("userPaperTestId", 224103);
		params.put("score", 40);
		Map<String, Object> map = Maps.newHashMap();
		Map<String, Object> answerMap = Maps.newHashMap();
		answerMap.put("answerId", 202515);
		List<Map<String, Object>> answerList = Lists.newArrayList();
		answerList.add(answerMap);
		map.put("exerciseId", 202512);
		map.put("answerList", answerList);

		List<Object> list = Lists.newArrayList();
		list.add(map);

		String jsonStr = JSONArray.toJSONString(list);
		params.put("temporaryExerciseAndAnswerStr", jsonStr);
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	
	public static void test_getPubResources() {
		String uri = "http://127.0.0.1:8080/ARVR/action/appInterface";
		uri += "/appProduct/getPubResources";
		Map<String, Object> params = Maps.newHashMap();
		params.put("deviceCode", "73fa50f54eff2a7aeff8a3b1c060554");
		params.put("tokenId",
				"tokenId-435EVapJqkyC12GJSB8EtQCFLLMYpfVOrU84PBk+sHQNbZZx1HRDVYN/BcZWV1GncEeq3kraa92iXEQ96Ps2TK+7EfUkHj6h2DPm+N4SWKk=");
		params.put("resourceNum", 10001);
		params.put("platformType", 1);
		String doPost = HttpClientUtilCustom.doPost(uri, params);
		System.out.println(doPost);
	}

	// test
	public static void main(String[] args) {
		 //Test_findProductGoodsList();
		// Test_getVerificationCode();
		// Test_exchangeProductGoods();
		// Test_findProductCourseList();
		// test_findCorrelatedGoods();
		// Test_findResourceUrl();
		// test_findConfigRechargeList();
//		 test_weChatRecharge();
		// test_appUserSign();
		// test_receiveSignAward();
		// test_findAppNoticeList();
		 test_mobileLogin();
//		 test_appUserStartAnswer();
//		 test_paperTestTemporary();
//		 test_submitUserPaperTest();
//		 test_findAppUserExercisesCourseList();
		/*test_getPubResources();*/
	}
}
